﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Query_OutStore.aspx.cs" Inherits="InfoQuery_Query_OutStore" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>入库查询</title>
    <link href="../css/PageStyle.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../JavaScript/Common.js"></script>
    <script type="text/javascript">

        function Onextcomb_Supplier_BeforeSelect() {
            console.log("Onextcomb_Supplier_BeforeSelect");
            if (extcomb_SupplyId.mimicing == false)
                return false;
        }
        function SearchOperate() {
            console.log("SearchOperate");
            Store_Customer.reload();
        }
        function SearchOperate2() {
            console.log("SearchOperate2");
            if (extcomb_SupplyId.text == "") {
                Store_Customer.reload();
            }
        }

    </script>
</head>
<body>
    <form id="form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server" AjaxViewStateMode="Enabled" />
        <ext:Viewport ID="Viewport1" runat="server" Layout="FitLayout">
            <Content>
                <ext:Panel runat="server" Border="false" Layout="RowLayout">
                    <TopBar>
                        <ext:Toolbar runat="server">
                            <Items>
                                <ext:Button ID="extBtn_Refresh" runat="server" Text="刷新" Icon="ArrowRefresh">
                                    <Listeners>
                                        <Click Handler="gridPanel_listdata.reload();" />
                                    </Listeners>
                                </ext:Button>
                            </Items>
                        </ext:Toolbar>
                    </TopBar>
                    <Items>
                        <ext:FormPanel ID="searchForm" runat="server" Border="false" Padding="5" Height="147">
                            <Content>
                                <ext:FieldSet runat="server" Title="查询条件" Border="true" Layout="ColumnLayout" Header="true" Height="134">
                                    <Items>
                                        <ext:Container runat="server" Layout="FormLayout" LabelAlign="Right" ColumnWidth="0.33">
                                            <Items>
                                                <ext:TextField runat="server" ID="exttxtf_BoundNo" FieldLabel="出库单号" AnchorHorizontal="0.95" />
                                                <ext:ComboBox ID="extcomb_STOREROOM_ID" runat="server" FieldLabel="库房名称"
                                                    AnchorHorizontal="0.95" Editable="false" ValueField="STOREROOM_ID" DisplayField="STOREROOM_NAME"
                                                    TabIndex="2">
                                                    <Store>
                                                        <ext:Store ID="Store_Rome" runat="server">
                                                            <Reader>
                                                                <ext:JsonReader IDProperty="STOREROOM_ID">
                                                                    <Fields>
                                                                        <ext:RecordField Name="STOREROOM_ID" />
                                                                        <ext:RecordField Name="STOREROOM_NAME" />
                                                                    </Fields>
                                                                </ext:JsonReader>
                                                            </Reader>
                                                        </ext:Store>
                                                    </Store>
                                                </ext:ComboBox>
                                                <ext:TextField runat="server" ID="exttxtf_Version" FieldLabel="型号" AnchorHorizontal="0.95" />
                                                <ext:TextField runat="server" ID="exttxtf_CargoCode" FieldLabel="商品代码" AnchorHorizontal="0.95" />
                                            </Items>
                                        </ext:Container>
                                        <ext:Container runat="server" Layout="FormLayout" LabelAlign="Right" ColumnWidth="0.33">
                                            <Items>
                                                <ext:CompositeField ID="CompositeField1" runat="server" AnchorHorizontal="0.95" FieldLabel="定制时间">
                                                    <Items>
                                                        <ext:DateField ID="extdate_start" Vtype="daterange" runat="server" Flex="1" TabIndex="4">
                                                            <Listeners>
                                                                <Render Handler="this.endDateField = '#{extdate_end}'" />
                                                            </Listeners>
                                                        </ext:DateField>
                                                        <ext:Label ID="Label1" runat="server" Text="到" StyleSpec=" padding-top:3px;">
                                                        </ext:Label>
                                                        <ext:DateField ID="extdate_end" Vtype="daterange" runat="server" Flex="1" TabIndex="5">
                                                            <Listeners>
                                                                <Render Handler="this.startDateField = '#{extdate_start}'" />
                                                            </Listeners>
                                                        </ext:DateField>
                                                    </Items>
                                                </ext:CompositeField>
                                                <ext:TextField runat="server" ID="exttxtf_CargoName" FieldLabel="商品名称" AnchorHorizontal="0.95" />
                                                <ext:TextField runat="server" ID="exttxtf_ProduceName" FieldLabel="生产厂家" AnchorHorizontal="0.95" />
                                                <ext:TextField runat="server" ID="exttxtf_BatchNo" FieldLabel="批号" AnchorHorizontal="0.95" />
                                            </Items>
                                        </ext:Container>
                                        <ext:Container ID="Container2" runat="server" Layout="FormLayout" LabelAlign="Right" ColumnWidth="0.33">
                                            <Items>
                                                <ext:ComboBox runat="server" ID="extcomb_CustomerId" FieldLabel="客户"
                                                    DisplayField="CustomerName" ValueField="CustomerId" TypeAhead="false" LoadingText="Searching..."
                                                    TriggerAction="All" ForceSelection="false" SelectOnFocus="true" EmptyText="请输入汉字或拼音简码"
                                                    Mode="Remote" ItemSelector="div.search-item" MinChars="1" ListWidth="600" TabIndex="10"
                                                    AnchorHorizontal="0.95" PageSize="10">
                                                    <Template ID="Template1" runat="server">
                                                        <Html>
                                                            <table width="100%" style="background-color: #f0f0f0; font-size: small; font-weight: bold">
                                                                <tr>
                                                                    <td style="width: 33%;">客户</td>
                                                                    <td style="width: 33%;">拼音码</td>
                                                                    <td style="width: 33%;">地址</td>
                                                                </tr>
                                                            </table>
                                                            <tpl for=".">
                                                                <div class="search-item">
                                                                    <table width="100%">
                                                                        <tr>
                                                                            <td style="width:33%; ">{CustomerName}</td>
                                                                            <td style="width:33%; ">{Spell}</td>
                                                                            <td style="width:33%; ">{Address}</td>
                                                                        </tr>
                                                                    </table>
                                                                </div>
                                                            </tpl>
                                                        </Html>
                                                    </Template>
                                                    <Listeners>
                                                        <Change Fn="SearchOperate" />
                                                        <KeyDown Fn="SearchOperate2" />
                                                        <Expand Fn="SearchOperate" />
                                                        <BeforeSelect Fn="Onextcomb_Supplier_BeforeSelect" />
                                                    </Listeners>
                                                    <Store>
                                                        <ext:Store runat="server" ID="Store_Customer" OnRefreshData="StoreCustomer_Refresh" RemotePaging="true">
                                                            <Reader>
                                                                <ext:JsonReader IDProperty="CustomerId">
                                                                    <Fields>
                                                                        <ext:RecordField Name="CustomerId" />
                                                                        <ext:RecordField Name="CustomerName" />
                                                                        <ext:RecordField Name="Spell" />
                                                                        <ext:RecordField Name="Address" />
                                                                    </Fields>
                                                                </ext:JsonReader>
                                                            </Reader>
                                                        </ext:Store>
                                                    </Store>
                                                </ext:ComboBox>
                                                <ext:TextField runat="server" ID="exttxtf_Spec" FieldLabel="规格" AnchorHorizontal="0.95" />
                                                <ext:TextField runat="server" ID="exttxtf_Area" FieldLabel="产地" AnchorHorizontal="0.95" />
                                                <ext:Container ID="Container1" runat="server" Layout="ColumnLayout">
                                                    <Items>
                                                        <ext:Panel ID="Panel2" runat="server" Height="25" AnchorHorizontal="0.95" Border="false" ButtonAlign="Right">
                                                            <Content>
                                                                <table width="100%">
                                                                    <tr style="width: 100%">
                                                                        <td align="right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                        </td>
                                                                        <td align="right" width="50%">
                                                                            <ext:Button ID="extBtn_Search" runat="server" Text="查询" Icon="Find">
                                                                                <Listeners>
                                                                                    <Click Handler="gridPanel_listdata.reload();" />
                                                                                </Listeners>
                                                                            </ext:Button>
                                                                        </td>
                                                                        <td align="right">&nbsp;&nbsp;&nbsp;&nbsp;
                                                                        </td>
                                                                        <td align="left" width="50%">
                                                                            <ext:Button ID="extBtn_Clear" runat="server" Text="清空" Icon="BasketDelete">
                                                                                <Listeners>
                                                                                    <Click Handler="searchForm.reset();" />
                                                                                </Listeners>
                                                                            </ext:Button>
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </Content>
                                                        </ext:Panel>
                                                    </Items>
                                                </ext:Container>
                                            </Items>
                                        </ext:Container>
                                    </Items>
                                </ext:FieldSet>
                            </Content>
                        </ext:FormPanel>
                        <ext:Panel runat="server" Border="false" RowHeight="1" Layout="FitLayout">
                            <Content>
                                <ext:GridPanel runat="server" ID="gridPanel_listdata" BodyStyle="border-width:1 0 0 0;" AutoScroll="true" TrackMouseOver="true" StripeRows="true">
                                    <ColumnModel>
                                        <Columns>
                                            <ext:RowNumbererColumn Header="<center>序号</center>" Width="35" />
                                            <ext:DateColumn Header="<center>出库时间</center>" Width="140" DataIndex="CheckDate" Format="Y-m-d h:i:s" />
                                            <ext:Column Header="<center>出库单号</center>" Width="120" DataIndex="BoundNo" />
                                            <ext:Column Header="<center>商品编码</center>" Width="100" DataIndex="CargoCode" />
                                            <ext:Column Header="<center>商品名称</center>" Width="100" DataIndex="CargoName" />
                                            <ext:Column Header="<center>规格</center>" Width="100" DataIndex="Spec" />
                                            <ext:Column Header="<center>型号</center>" Width="100" DataIndex="Version" />
                                            <ext:Column Header="<center>生产厂家</center>" Width="100" DataIndex="ProduceName" />
                                            <ext:Column Header="<center>产地</center>" Width="100" DataIndex="Area" />
                                            <ext:Column Header="<center>计量单位</center>" Width="100" DataIndex="Unit" />
                                            <ext:Column Header="<center>批号</center>" Width="100" DataIndex="BatchNo" />
                                            <ext:Column Header="<center>采购单价</center>" Width="100" DataIndex="Supplyprice" />
                                            <ext:Column Header="<center>数量</center>" Width="150" DataIndex="Count" />
                                            <ext:Column Header="<center>采购金额</center>" Width="150" DataIndex="SumSupplyprice" />
                                            <ext:Column Header="<center>库房</center>" Width="80" DataIndex="STOREROOM_NAME" />
                                            <ext:Column Header="<center>客户</center>" Width="80" DataIndex="CustomerName" />
                                        </Columns>
                                    </ColumnModel>
                                    <Store>
                                        <ext:Store runat="server" ID="Store1" OnRefreshData="MyData_Refresh">
                                            <Reader>
                                                <ext:JsonReader IDProperty="DetailId">
                                                    <Fields>
                                                        <ext:RecordField Name="DetailId" Type="Int" />
                                                        <ext:RecordField Name="DBoundId" Type="Int"/>
                                                        <ext:RecordField Name="OrderId" Type="Int" />
                                                        <ext:RecordField Name="Count" Type="Int" />
                                                        <ext:RecordField Name="DetailId" Type="Int" />
                                                        <ext:RecordField Name="BatchNo" />
                                                        <ext:RecordField Name="ProduceDate" Type="Date" />
                                                        <ext:RecordField Name="DisinfectionDate" Type="Date" />
                                                        <ext:RecordField Name="ExpiryDate" Type="Date" />
                                                        <ext:RecordField Name="AsepticDate" Type="Date" />
                                                        <ext:RecordField Name="CheckState" Type="Int" />
                                                        <ext:RecordField Name="State" Type="Int" />
                                                        <ext:RecordField Name="BoundNo" />
                                                        <ext:RecordField Name="DeliveryNo" />
                                                        <ext:RecordField Name="CheckDate" Type="Date" />
                                                        <ext:RecordField Name="StoreRoomId" Type="Int" />
                                                        <ext:RecordField Name="STOREROOM_NAME" />
                                                        <ext:RecordField Name="CustomerId" Type="Int" />
                                                        <ext:RecordField Name="CustomerName" />
                                                        <ext:RecordField Name="Supplyprice" Type="Float" />
                                                        <ext:RecordField Name="SumSupplyprice" Type="Float" />
                                                        <ext:RecordField Name="CargoName" />
                                                        <ext:RecordField Name="CargoCode" />
                                                        <ext:RecordField Name="Spec" />
                                                        <ext:RecordField Name="Version" />
                                                        <ext:RecordField Name="ProduceName" />
                                                        <ext:RecordField Name="Area" />
                                                        <ext:RecordField Name="Unit" />
                                                    </Fields>
                                                </ext:JsonReader>
                                            </Reader>
                                        </ext:Store>
                                    </Store>
                                    <SelectionModel>
                                        <ext:RowSelectionModel runat="server" SingleSelect="true" />
                                    </SelectionModel>
                                    <BottomBar>
                                        <ext:PagingToolbar runat="server" ID="PagingToolbar1" PageSize="20" DisplayInfo="true"
                                            Height="25" DisplayMsg="显示{0} - {1},共{2}条" EmptyMsg="没有可显示的记录" StateID="Store1" />
                                    </BottomBar>
                                </ext:GridPanel>
                            </Content>
                        </ext:Panel>
                    </Items>
                </ext:Panel>
            </Content>
        </ext:Viewport>
    </form>
</body>
</html>
